<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>

<%@ include file="../init_include.jsp" %>
<%
	Sysop sysop=(Sysop)session.getAttribute("sysop");
	if ( sysop==null)
	{
		dbi.closeAll();
		return;
	}

	Integer userId,moduleId;
	Integer moduleNum;
	String tmpStr;

		moduleNum=new Integer(request.getParameter("moduleNum"));
		out.println("moduleNum="+moduleNum+"<br>");
		
		for (int i=0;i<moduleNum.intValue();i++)
		{
			if (request.getParameter("checkbox"+i)!=null)
			{
				tmpStr=request.getParameter("checkbox"+i);
				try
				{
					userId=new Integer(tmpStr.substring(0,tmpStr.lastIndexOf("-")));
					moduleId=new Integer(tmpStr.substring(tmpStr.lastIndexOf("-")+1,tmpStr.length()));
				}catch(Exception e)
				{
					out.println(e);
					return;
				}
				String sql="delete from sysop_module where userid="+userId+" and moduleid="+moduleId;
				out.println(sql+"<br>");
				
				Sysop.deleteModules(dbi,sql);		
			}
		}
		response.sendRedirect("userCommission.jsp?userid="+request.getParameter("userid"));
%>	
<%@ include file="../init_free.jsp" %>
